package com.zerui.manager.device;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.sql.Time;
import java.time.LocalDateTime;

/**
 * @Author wh
 * @create_time 2023-08-23 11:07
 */
@ApiModel("设备")
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Device {

	@ApiModelProperty("主键，无业务含义")
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long id;

	@ApiModelProperty("设备id - 关联设备管理id")
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long deviceId;

	@ApiModelProperty("进出方向 0：进 1：出")
	private Integer access;

	@ApiModelProperty(value="启用状态 0：启用，1：禁用")
	private Integer enableStatus;

	@ApiModelProperty("结束时间")
	private Time endTime;

	@ApiModelProperty("开始时间")
	private Time startTime;

	@ApiModelProperty("定时任务开关 0：开 1：关")
	private Integer timedTaskStatus;

	@ApiModelProperty("门禁高级按钮执行状态")
	private String curfewStatus;

	@ApiModelProperty("创建时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
	private LocalDateTime createTime;


	public static Device create(Long deviceId,Integer enableStatus,Integer access){
		return Device.builder()
				.deviceId(deviceId)
				.enableStatus(enableStatus)
				.access(access)
				.createTime(LocalDateTime.now())
				.build();

	}



}
